appSkeleton.service('UtilServicesSkeleton', ['$window', '$document',"$timeout",'$filter','DialogBoxService','ERROR_CODE',
    function ($window, $document,$timeout,$filter,DialogBoxService,ERROR_CODE) {

    return {

        showErrorMessage: function(scope, error){
            var messageTitle = $filter('i18n')('title','error-message');
            var okButton = $filter('i18n')('ok','error-message');
            var message ;
            if(error == ERROR_CODE.NO_PERMISSION){
                message = $filter('i18n')('permissionErrorMessage', 'error-message');
            }
            else{
                message = $filter('i18n')('message', 'error-message');
            }

            DialogBoxService.show(scope, messageTitle, message, [okButton]).then(function (item) {
            });
        },

        loginTimeout : function(response){
            if (response.status == ERROR_CODE.LOGIN_TIMEOUT) {
                var message = $filter('i18n')('message', 'error-message');
                //alert(message);
                $window.location.reload();
            }
        }


    }

}]);